package org.stars.dao.config;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

@Root
public class DataSource {

	public DataSource() {
		connectionProperties = new ConnectionProperties();
	}
	
	@Attribute(required=true)
	protected String id;
	
	@Attribute(required=false)
	protected boolean defaultConnection;
	
	@Attribute(required=false)
	protected boolean traceable;

	@Attribute(required=false)
	protected String type;

	@Element(required=false)
	protected String url;

	@Element(required=false)
	protected String username;

	@Element(required=false)
	protected String password;

	@Element(required=false)
	protected String driverClassName;

	@Element(required=false)
	protected ConnectionProperties connectionProperties;

	@Element(required=false)
	protected String defaultAutoCommmit;

	@Element(required=false)
	protected String defaultTransactionIsolation;
	@Element(required=false)
	protected String defaultCatalog;
	@Element(required=false)
	protected String initialSize;
	@Element(required=false)
	protected String maxActive;
	@Element(required=false)
	protected String maxIdle;
	@Element(required=false)
	protected String minIdle;
	@Element(required=false)
	protected String maxWait;
	@Element(required=false)
	protected String validationQuery;
	@Element(required=false)
	protected String testOnBorrow;

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getDriverClassName() {
		return driverClassName;
	}

	public void setDriverClassName(String driverClassName) {
		this.driverClassName = driverClassName;
	}

	public ConnectionProperties getConnectionProperties() {
		return connectionProperties;
	}

	public void setConnectionProperties(ConnectionProperties connectionProperties) {
		this.connectionProperties = connectionProperties;
	}

	public String getDefaultAutoCommmit() {
		return defaultAutoCommmit;
	}

	public void setDefaultAutoCommmit(String defaultAutoCommmit) {
		this.defaultAutoCommmit = defaultAutoCommmit;
	}

	public String getDefaultTransactionIsolation() {
		return defaultTransactionIsolation;
	}

	public void setDefaultTransactionIsolation(String defaultTransactionIsolation) {
		this.defaultTransactionIsolation = defaultTransactionIsolation;
	}

	public String getDefaultCatalog() {
		return defaultCatalog;
	}

	public void setDefaultCatalog(String defaultCatalog) {
		this.defaultCatalog = defaultCatalog;
	}

	public String getInitialSize() {
		return initialSize;
	}

	public void setInitialSize(String initialSize) {
		this.initialSize = initialSize;
	}

	public String getMaxActive() {
		return maxActive;
	}

	public void setMaxActive(String maxActive) {
		this.maxActive = maxActive;
	}

	public String getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(String maxIdle) {
		this.maxIdle = maxIdle;
	}

	public String getMinIdle() {
		return minIdle;
	}

	public void setMinIdle(String minIdle) {
		this.minIdle = minIdle;
	}

	public String getMaxWait() {
		return maxWait;
	}

	public void setMaxWait(String maxWait) {
		this.maxWait = maxWait;
	}

	public String getValidationQuery() {
		return validationQuery;
	}

	public void setValidationQuery(String validationQuery) {
		this.validationQuery = validationQuery;
	}

	public String getTestOnBorrow() {
		return testOnBorrow;
	}

	public void setTestOnBorrow(String testOnBorrow) {
		this.testOnBorrow = testOnBorrow;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public boolean isDefaultConnection() {
		return defaultConnection;
	}

	public void setDefaultConnection(boolean defaultConnection) {
		this.defaultConnection = defaultConnection;
	}

	public boolean isTraceable() {
		return traceable;
	}

	public void setTraceable(boolean traceable) {
		this.traceable = traceable;
	}

}
